<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>输血管理系统</title>
    <link rel="shortcut icon" type="image/x-icon" href="../img/favicon.ico">
    <link rel="stylesheet" href="../element-theme/blue/index.css">
</head>
<body>
<div class="data-manage-table">
    <template>
        <el-form ref="form" :inline="true" style="padding:20px 20px 0 20px;">
            <el-form-item label="患者病历号">
                <el-input placeholder="请输入患者病历号" v-model="searchSample. medicalRecordNumber"></el-input>
            </el-form-item>
            <el-form-item label="日期">
                <el-date-picker v-model="searchSample.dateVal" type="daterange" size="small" format="yyyy-MM-dd"
                                range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item>
                <el-button type="primary">搜索</el-button>
                <el-button type="primary" @click="add">新增</el-button>
                <el-button type="info">清空</el-button>
                <el-button type="primary" @click="transfusion">输血申请</el-button>
            </el-form-item>
        </el-form>
        <el-dialog title="输血申请类型选择" center :visible.sync="dialogTranVisible" width="45%" @close="cancel">
            <el-form ref="form" :model="addForm" :rules="addFormRules" label-width="100px" inline align="center" style="-webkit-border-vertical-spacing: 13px">
            <el-row><el-button type="primary" @click="clinic" >临床输血申请</el-button></el-row>
            <el-button type="primary" @click="auto" >自体输血申请</el-button>
            <el-row><el-button type="primary" @click="surgey" >术中输血申请</el-button></el-row>
            </el-form>
        </el-dialog>

        <el-dialog title=“添加患者信息" center :visible.sync="dialogVisible" width="45%" @close="cancel">
            <!-- 内容的主体区域 -->
            <el-form ref="form" :model="addForm" :rules="addFormRules" label-width="100px" >
                <el-form-item label="病历号" prop="medicalRecordNumber">
                    <el-input v-model="addForm.medicalRecordNumber" ></el-input>
                </el-form-item>
                <el-form-item label="身份证号" prop="patientIdCard">
                    <el-input  v-model="addForm.patientIdCard" maxlength="18"  show-word-limit></el-input>
                </el-form-item>
                <el-form-item label="姓名" prop="name">
                    <el-input v-model="addForm.name">
                    </el-input>
                </el-form-item>
                <el-form-item label="性别" prop="gender">
                    <el-select v-model="addForm.gender">
                        <el-option v-for="item in location" :key="item.value" :label="item.label"
                                   :value="item.value" width="50px">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="年龄" prop="age">
                    <el-input-number v-model="addForm.age" controls-position="right" @change="handleChange" :min="1" :max="10"></el-input-number>
                </el-form-item>
                <el-form-item label="民族" prop="nationality">
                    <el-select v-model="addForm.nationality" placeholder="请选择民族" filterable>
                        <el-option v-for="item in optionNationality" :key="item.code" :label="item.name"
                                   :value="item.name" width="50px">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="科别" prop="department">
                    <el-select v-model="departmentSample.code"  @change="getDcode()" clearable placeholder="请选择一级科室" filterable>
                        <el-option v-for="item in parentDepartmentGroups" :label="item.name" :key="item.code" :value="item.code"></el-option>
                    </el-select>
                    <el-select v-model="addForm.department" clearable placeholder="请选择二级科室" filterable>
                        <el-option v-for="item in childDepartmentGroups" :label="item.name" :key="item.code" :value="item.name"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="床号" prop="bedNumber">
                    <el-input v-model="addForm.bedNumber"></el-input>
                </el-form-item>
                <el-form-item label="既往病史" prop="medicalHistory">
                    <el-input v-model="addForm.medicalHistory"></el-input>
                </el-form-item>
                <el-form-item label="既往输血史" prop="tansfusionHistory">
                    <el-input v-model="addForm.tansfusionHistory"></el-input>
                </el-form-item>
                <el-form-item label="孕次数" prop="prengancy">
                    <el-input v-model="addForm.prengancy"></el-input>
                </el-form-item>
                <el-form-item label="产次数" prop="production">
                    <el-input v-model="addForm.production"></el-input>
                </el-form-item>
                <el-form-item label="属地" prop="territorial">
                    <div style="width:460px;">
                        <el-cascader style="width:100%;" :options="options"
                                     v-model="selectedOptions" @change="addressChoose"></el-cascader>
                    </div>
                </el-form-item>
                <el-form-item label="单位" prop="unit">
                    <el-input v-model="addForm.unit"></el-input>
                </el-form-item>
            </el-form>
            <!-- 底部区域 -->
            <span slot="footer" class="dialog-footer">
                    <el-button @click="cancel()">取 消</el-button>
                    <el-button type="primary" @click="save">确 定</el-button>
                </span>
        </el-dialog>

        <el-dialog title="临床输血申请" center :visible.sync="dialogClinicVisible" width="45%" @close="cancel">
            <!-- 内容的主体区域 -->
            <el-form ref="form" :rules="addFormRules" label-width="100px" :inline="true">
                    <el-form-item  label="病案号">
                        <el-input  type="text" id="a" placeholder="请输入患者病案号" v-model="clinicSample.medicalRecordNumber"></el-input>
                    </el-form-item>
                <el-form-item label="临床输血申请单号">
                    <el-input type="text" placeholder="请输入单号" v-model="clinicSample.transfusionNumber" ></el-input>
                </el-form-item>

                    <el-form-item label="受血者身份证号" prop="patientIdCard">
<!--                        <template slot-scope="scope">-->
                        <el-input type="text" placeholder="请输入受血者身份证号" v-model="bloodSample.patientIdCard" @change="bloodInfo()"></el-input>
<!--                        </template>-->
                    </el-form-item>
                    <el-form-item label="临床诊断">
                        <el-input type="textarea" :rows="5" placeholder="请输入临床诊断" v-model="clinicSample.clinicalDiagnosis" style="width: 500px"></el-input>
                    </el-form-item>
                <el-row>
                    <el-form-item label="输血目的" >
                        <el-input type="textarea" :rows="5" placeholder="请输入输血目的" v-model="clinicSample.transfusionPurpose" style="width: 500px"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="悬浮红细胞">
                        <el-input placeholder="请输入悬浮红细胞注射量" v-model="clinicSample.suspendedRbc"></el-input>
                    </el-form-item>

                    <el-form-item label="血浆">
                        <el-input placeholder="请输入血浆注射量" v-model="clinicSample.plasma"></el-input>
                    </el-form-item>

                    <el-form-item label="血小板">
                        <el-input placeholder="请输入血小板注射量" v-model="clinicSample.platelet"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="洗涤红细胞">
                        <el-input placeholder="请输入洗涤红细胞注射量" v-model="clinicSample.washRbc"></el-input>
                    </el-form-item>
                    <el-form-item label="全血">
                        <el-input placeholder="请输入全血注射量" v-model="clinicSample.wholeBlood"></el-input>
                    </el-form-item>
                    <el-form-item label="其他">
                        <el-input placeholder="请输入其他注射量" v-model="clinicSample.other"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="预定输血日期">
                        <el-date-picker
                                v-model="clinicSample.scheduledTransfusionTime"
                                type="date"
                                placeholder="选择日期"
                                size="small"
                                format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="辐照血">
                        <el-select v-model="clinicSample.isIrradiationBlood">
                            <el-option v-for="item in options1" :key="item.value" :label="item.label"
                                       :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="过滤血">
                        <el-select v-model="clinicSample.isFilteringBlood">
                            <el-option v-for="item in options1" :key="item.value" :label="item.label"
                                       :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="复检">
                        <el-select v-model="clinicSample.isRecheck">
                            <el-option v-for="item in options1" :key="item.value" :label="item.label"
                                       :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="接受标本时间">
                        <el-date-picker
                                v-model="clinicSample.acceptSampleTime"
                                type="date"
                                placeholder="选择日期"
                                size="small"
                                format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="申请医师">
                        <el-input placeholder="请输入申请医师" v-model="clinicSample.applyDoctor"></el-input>
                    </el-form-item>
                    <el-form-item label="主治医师">
                        <el-input placeholder="请输入主治医师" v-model="clinicSample.attendingPhysician"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="申请日期">
                        <el-date-picker
                                v-model="clinicSample.applyTime"
                                type="date"
                                placeholder="选择日期"
                                size="small"
                                format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="输血同意书">
                        <el-select v-model="clinicSample.isSignConsentForm">
                            <el-option label="已签" value="1"></el-option>
                            <el-option label="未签" value="0"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="受血者血液标本">
                        <el-select v-model="clinicSample.recipientSpecimen">
                            <el-option label="有" value="1"></el-option>
                            <el-option label="已抽血未回" value="0"></el-option>
                        </el-select>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="接收标本时间">
                        <el-date-picker
                                v-model="clinicSample.receiveSampleTime"
                                type="date"
                                placeholder="选择日期"
                                size="small"
                                format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="受血者ABO血型">
                        <el-input  v-model="bloodSample.bloodType"></el-input>
                    </el-form-item>
                    <el-form-item label="受血者Rh（D）血型">
                        <el-input  v-model="bloodSample.rhd"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="谷丙转氨酶">
                        <el-input  v-model="bloodSample.alt"></el-input>
                    </el-form-item>
                    <el-form-item label="红细胞">
                        <el-input  v-model="bloodSample.rbc"></el-input>
                    </el-form-item>
                    <el-form-item label="乙肝表面抗原">
                        <el-input  v-model="bloodSample.hbsag"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="血红蛋白">
                        <el-input  v-model="bloodSample.hb"></el-input>
                    </el-form-item>
                    <el-form-item label="丙肝抗体">
                        <el-input  v-model="bloodSample.hcv"></el-input>
                    </el-form-item>
                    <el-form-item label="血小板">
                        <el-input  v-model="bloodSample.plt"></el-input>
                    </el-form-item>
                    <el-form-item label="梅毒">
                        <el-input  v-model="bloodSample.rpr"></el-input>
                    </el-form-item>
                </el-row>


            </el-form>
            <!-- 底部区域 -->
            <span slot="footer" class="dialog-footer">
                    <el-button @click="cancel()">取 消</el-button>
                    <el-button type="primary" @click="saveClinic">申 请</el-button>
                </span>
        </el-dialog>

        <el-dialog title="自体输血申请" center :visible.sync="dialogAutoVisible" width="45%" @close="cancel">
            <!-- 内容的主体区域 -->
            <el-form ref="form" :model="autoSample" :rules="addFormRules" label-width="100px" :inline="true">
                <el-row>
                    <el-form-item label="输血申请单号">
                        <el-input placeholder="请输入输血申请单号" v-model="autoSample.transfusionNumber"></el-input>
                    </el-form-item>
                    <el-form-item label="住院号">
                        <el-input placeholder="请输入受血者住院号" v-model="autoSample.medicalRecordNumber"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="临床诊断">
                        <el-input type="textarea" :rows="5" placeholder="请输入临床诊断" v-model="autoSample.diagnosisResult" style="width: 500px"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="拟备血量" >
                        <el-input type="textarea" :rows="5" placeholder="请输入拟备血量" v-model="autoSample.prepareVolume" ></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="拟手术日期">
                            <el-date-picker
                                    v-model="autoSample.surgeryTime"
                                    type="date"
                                    placeholder="选择日期"
                                    size="small"
                                    format="yyyy-MM-dd">
                            </el-date-picker>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="体重">
                        <el-input placeholder="请输入体重" v-model="autoSample.weight"></el-input>
                    </el-form-item>

                    <el-form-item label="血小板计数">
                        <el-input placeholder="血小板计数" v-model="autoSample.plateletCount"></el-input>
                    </el-form-item>

                    <el-form-item label="血红蛋白">
                        <el-input placeholder="血红蛋白" v-model="autoSample.hemoglobin"></el-input>
                    </el-form-item>
                    <el-form-item label="红细胞比容">
                        <el-input placeholder="红细胞比容" v-model="autoSample.hematocrit"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="申请医师">
                        <el-input placeholder="请输入申请医师" v-model="autoSample.applyDoctor"></el-input>
                    </el-form-item>
                    <el-form-item label="申请日期">
                            <el-date-picker
                                    v-model="autoSample.applyTime"
                                    type="date"
                                    placeholder="选择日期"
                                    size="small"
                                    format="yyyy-MM-dd">
                            </el-date-picker>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="鉴定血型">
                        <el-select v-model="autoSample.identifyBloodType">
                            <el-option label="A" value="A"></el-option>
                            <el-option label="B" value="B"></el-option>
                            <el-option label="O" value="O"></el-option>
                            <el-option label="AB" value="AB"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="鉴定Rho">
                        <el-select v-model="autoSample.identifyRho">
                            <el-option label="+" value="+"></el-option>
                            <el-option label="-" value="-"></el-option>
                        </el-select>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="鉴定者">
                        <el-input placeholder="请输入鉴定者" v-model="autoSample.appraiser"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="回输时间">
                        <el-date-picker
                                v-model="autoSample.backTime"
                                type="date"
                                placeholder="选择日期"
                                size="small"
                                format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="回输量">
                        <el-input  v-model="autoSample.backVolume"></el-input>
                    </el-form-item>
                    <el-form-item label="取血人">
                        <el-input  v-model="autoSample.bloodTaker"></el-input>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="发血人">
                        <el-input  v-model="autoSample.bloodSender"></el-input>
                    </el-form-item>
                    <el-form-item label="采血者">
                        <el-input  v-model="autoSample.bloodCollector"></el-input>
                    </el-form-item>
                    <el-form-item label="心功能">
                        <el-input  v-model="autoSample.heartFunction"></el-input>
                    </el-form-item>
                    <el-form-item label="肺功能">
                        <el-input  v-model="autoSample.lungFunction"></el-input>
                    </el-form-item>
                    <el-form-item label="肝功能">
                        <el-input  v-model="autoSample.liverFunction"></el-input>
                    </el-form-item>
                    <el-form-item label="肾功能">
                        <el-input  v-model="autoSample.renalFunction"></el-input>
                    </el-form-item>
                    <el-form-item label="自体输血同意书">
                        <el-select v-model="autoSample.isAutobloodtranAgreement">
                            <el-option label="是" value="1"></el-option>
                            <el-option label="否" value="0"></el-option>
                        </el-select>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-form-item label="备注">
                        <el-input placeholder="请输入备注" v-model="autoSample.note"></el-input>
                    </el-form-item>
                </el-row>
            </el-form>
            <!-- 底部区域 -->
            <span slot="footer" class="dialog-footer">
                    <el-button @click="cancel()">取 消</el-button>
                    <el-button type="primary" @click="saveAuto">申 请</el-button>
                </span>
        </el-dialog>

        <el-dialog title="术中输血申请" center :visible.sync="dialogSurgeyVisible" width="45%" @close="cancel">
            <!-- 内容的主体区域 -->
            <el-form ref="form" :model="surgeySample" :rules="addFormRules" label-width="100px" :inline="true">
                <el-form-item label="输血申请单号" prop="transfusionNumber">
                    <el-input v-model="surgeySample.transfusionNumber"></el-input>
                </el-form-item>
                <el-form-item label="病案号" prop="medicalRecordNumber">
                    <el-input v-model="surgeySample.medicalRecordNumber"></el-input>
                </el-form-item>
                <el-form-item label="身份证号">
                    <el-input placeholder="请输入受血者身份证号" v-model="autoSample.patientIdCard"></el-input>
                </el-form-item>
                <el-form-item label="ABO血型" prop="aboBloodType">
                    <el-select v-model="surgeySample.aboBloodType">
                    <el-option label="A" value="A"></el-option>
                    <el-option label="B" value="B"></el-option>
                    <el-option label="O" value="O"></el-option>
                    <el-option label="AB" value="AB"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="Rh血型" prop="rhBloodType">
                    <el-select v-model="surgeySample.rhBloodType">
                        <el-option label="+" value="+"></el-option>
                        <el-option label="-" value="-"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="临床诊断" prop="clinicalDiagnosis">
                    <el-input v-model="surgeySample.clinicalDiagnosis"></el-input>
                </el-form-item>
                <el-form-item label="输血目的" prop="transfusionPurpose">
                    <el-input v-model="surgeySample.transfusionPurpose"></el-input>
                </el-form-item>
                <el-form-item label="自体输血时间">
                    <el-date-picker
                            v-model="surgeySample.autologousTransfusionTime"
                            type="date"
                            placeholder="选择日期"
                            size="small"
                            format="yyyy-MM-dd">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="自体血回收量" prop="autologousRecycleVolume">
                    <el-input v-model="surgeySample.autologousRecycleVolume"></el-input>
                </el-form-item>
                <el-form-item label="血液稀释量" prop="bloodDilution">
                    <el-input v-model="surgeySample.bloodDilution"></el-input>
                </el-form-item>
                <el-form-item label="血液单位" prop="bloodUnit">
                    <el-input v-model="surgeySample.bloodUnit"></el-input>
                </el-form-item>
                <el-form-item label="操作者" prop="operator">
                    <el-input v-model="surgeySample.operator"></el-input>
                </el-form-item>
                    <el-form-item label="操作日期">

                        <el-date-picker
                                v-model="surgeySample.operationTime"
                                type="date"
                                placeholder="选择日期"
                                size="small"
                                format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
            </el-form>
            <!-- 底部区域 -->
            <span slot="footer" class="dialog-footer">
                    <el-button @click="cancel()">取 消</el-button>
                    <el-button type="primary" @click="saveSurgey">申 请</el-button>
                </span>
        </el-dialog>
        <el-dialog title=“患者基本信息" center :visible.sync="dialogPatientVisible" width="45%" @close="cancel">
            <!-- 内容的主体区域 -->
            <el-form ref="form" :model="addForm" :rules="addFormRules" label-width="100px" :inline="true">
                <el-form-item label="病历号" prop="medicalRecordNumber">
                    <el-input v-model="addForm.medicalRecordNumber" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="身份证号" prop="patientIdCard">
                    <el-input v-model="addForm.patientIdCard" :disabled="true"></el-input>
                </el-form-item>
                <el-row><el-form-item label="姓名" prop="name">
                    <el-input v-model="addForm.name" :disabled="true">
                    </el-input>
                </el-form-item>
                <el-form-item label="性别" prop="gender">
                    <el-select v-model="addForm.gender">
                        <el-option v-for="item in location" :key="item.value" :label="item.label"
                                   :value="item.value" :disabled="true">
                        </el-option>
                    </el-select>
                </el-form-item></el-row>
                <el-form-item label="年龄" prop="age">
                    <el-input v-model="addForm.age" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="民族" prop="nationality">
                    <el-input v-model="addForm.nationality" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="科别" prop="department">
                    <el-input v-model="addForm.department" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="床号" prop="bedNumber">
                    <el-input v-model="addForm.bedNumber" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="既往病史" prop="medicalHistory">
                    <el-input v-model="addForm.medicalHistory" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="既往输血史" prop="tansfusionHistory">
                    <el-input v-model="addForm.tansfusionHistory" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="孕次数" prop="prengancy">
                    <el-input v-model="addForm.prengancy" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="产次数" prop="production">
                    <el-input v-model="addForm.production" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="属地" prop="territorial">
                    <el-input v-model="addForm.territorial" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="单位" prop="unit">
                    <el-input v-model="addForm.unit" :disabled="true"></el-input>
                </el-form-item>
            </el-form>
            <!-- 底部区域 -->
            <span slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="close()">确 定</el-button>
                </span>
        </el-dialog>

        <el-table :data="tableData" style="width: 100%" border
                  :header-cell-style="{'text-align': 'center','background': '#eef1f6'}" highlight-current-row
                  @current-change="">

            <el-table-column type="selection" width="55" align="center"></el-table-column>

            <el-table-column prop="medicalRecordNumber" label="病历号" width="100" align="center">
                <template slot-scope="scope">
                    <!--scope.row  会获取当前ID行记录-->
                    <el-button type="text" @click="viewInfo(scope.row)" >{{scope.row.medicalRecordNumber}}</el-button>
                </template>
            </el-table-column>

            <el-table-column prop="patientIdCard" label="身份证号" width="180" align="center">
            </el-table-column>
            <el-table-column prop="name" label="姓名" width="180" align="center">
            </el-table-column>


            <el-table-column prop="gender" label="性别" width="180" align="center">
            </el-table-column>

            <el-table-column prop="age" label="年龄" width="180" align="center">
            </el-table-column>

            <el-table-column prop="nationality" label="民族" width="100" align="center">
            </el-table-column>
            <el-table-column prop="department" label="科别" width="130" align="center">
            </el-table-column>
            <el-table-column prop="bedNumber" label="床号" width="130" align="center">
            </el-table-column>
            <el-table-column prop="medicalHistory" label="既往病史" width="130" align="center">
            </el-table-column>
            <el-table-column prop="tansfusionHistory" label="既往输血史" width="130" align="center">
            </el-table-column>
            <el-table-column prop="prengancy" label="孕次数" width="130" align="center">
            </el-table-column>
            <el-table-column prop="production" label="产次数" width="130" align="center">
            </el-table-column>
            <el-table-column prop="territorial" label="属地" width="130" align="center">
            </el-table-column>
            <el-table-column prop="unit" label="单位" width="130" align="center">
            </el-table-column>
                            <el-table-column fixed="right" label="操作" width="200" align="center">
                                <template slot-scope="scope">

                                    <el-button size="mini" type="danger" @click="del(scope.row.patientIdCard)">删除
                                    </el-button>
                                </template>
                            </el-table-column>
        </el-table>

        <el-pagination :page-size="10" :total="300" :current-page="5" layout="prev, pager, next, jumper"
                       class="pagination" @current-change="" style="text-align: center; margin-top: 20px;"></el-pagination>

    </template>
</div>
<!--<input type="text" id="a"/>-->
<script src="../plugins/vue-2.5.17/vue.js"></script>
<script src="../plugins/element-2.4.5/index.js"></script>
<script src="../icons/iconfont.js"></script>
<!--<script src="../qianduan/pages/element-china-area-data/src/app.js"></script>-->
<script src="../js/jquery.min.js"></script>
<script src="../js/axios.min.js"></script>
<script>Vue.prototype.$ELEMENT = { size: 'medium' };</script>
<script type="text/javascript">
    $(function(){
        $("#a").bind('input porpertychange',function(){
            console.log("e");
        });
    });
</script>
<script type="module">
    // import "./element-china-area-data/dist/app.js";
    (function () {
        var vm = window.vm = new Vue({
            el: '.data-manage-table',
            data() {
                return {
                    text:'',
                    //民族选项
                    optionNationality: [],
                    //科室选项
                    childDepartmentGroups:[],
                    parentDepartmentGroups:[],

                    code1:'',
                    options: regionDataPlus,
                    selectedOptions: [],
                    areaOptions: [],
                    options1: [{
                        value: '1',
                        label: '是'
                    }, {
                        value: '0',
                        label: '否'
                    }],
                    page: {},
                    name: '',
                    pageNum: 1,
                    pageSize: 8,
                    form: {},

                    location: [{
                        value: '1',
                        label: '男'
                    }, {
                        value: '2',
                        label: '女'
                    }],

                    //弹出框显示
                    dialogVisible: false,
                    dialogClinicVisible: false,
                    dialogAutoVisible: false,
                    dialogTranVisible: false,
                    dialogSurgeyVisible: false,
                    dialogPatientVisible: false,

                    searchSample: {
                        medicalRecordNumber: '',
                    },

                    departmentSample:{
                        code:'',
                        name:'',
                        parentCode:'',
                    },


                    clinicSample: {
                        medicalRecordNumber: '',
                        transfusionNumber:'',
                        patientIdCard: '',
                        clinicalDiagnosis: '',
                        transfusionPurpose: '',
                        suspendedRbc: '',
                        plasma: '',
                        platelet: '',
                        washRbc: '',
                        wholeBlood: '',
                        other: '',
                        scheduledTransfusionTime: '',
                        isIrradiationBlood: '',
                        isFilteringBlood: '',
                        isRecheck: '',
                        acceptSampleTime: '',
                        applyDoctor: '',
                        attendingPhysician: '',
                        applyTime: '',
                        isSignConsentForm: '',
                        recipientSpecimen: '',
                        receiveSampleTime: '',
                    },
                    autoSample: {
                        transfusionNumber: '',
                        medicalRecordNumber: '',
                        diagnosisResult: '',
                        prepareVolume: '',
                        surgeryTime: '',
                        weight: '',
                        plateletCount: '',
                        hemoglobin: '',
                        hematocrit: '',
                        applyDoctor: '',
                        applyTime: '',
                        identifyBloodType: '',
                        identifyRho: '',
                        appraiser: '',
                        backTime: '',
                        backVolume: '',
                        bloodTaker: '',
                        bloodSender: '',
                        bloodCollector: '',
                        heartFunction: '',
                        lungFunction: '',
                        liverFunction: '',
                        renalFunction: '',
                        isAutobloodtranAgreement: '',
                        note: '',
                    },
                    bloodSample: {
                        patientId:'',
                        bloodType:'',
                        rhd:'',
                        alt:'',
                        rbc:'',
                        hbsag:'',
                        hb:'',
                        hcv:'',
                        hiv:'',
                        plt:'',
                        rpr:'',
                        state:'',
                        reviewerName:'',
                        reviewerNumber:'',
                        reviewTime:'',
                    },
                    surgeySample: {
                        transfusionNumber: '',
                        medicalRecordNumber: '',
                        patientIdCard:'',
                        aboBloodType: '',
                        rhBloodType: '',
                        clinicalDiagnosis: '',
                        transfusionPurpose: '',
                        autologousTransfusionTime: '',
                        autologousRecycleVolume: '',
                        bloodDilution: '',
                        bloodUnit: '',
                        operator: '',
                        operationTime: '',
                    },

                    //表格信息
                    tableData: [],
                    //新增样本信息
                    addForm: {
                        medicalRecordNumber: '',
                        idcard: '',
                        name: '',
                        gender: '',
                        age: 1,
                        nationality: '',
                        department: '',
                        bedNumber: '',
                        medicalHistory: '',
                        tansfusionHistory: '',
                        prengancy: '',
                        production: '',
                        territorial: '',
                        unit: '',
                    },
                    //新增样本表单验证
                    addFormRules: {
                        medicalRecordNumber: [
                            {required: true, message: '请输入病历号', trigger: 'blur'},
                        ],
                        idcard: [
                            {required: true, message: '请输入身份证号', trigger: 'blur'},
                        ],
                        name: [
                            {required: true, message: '请输入姓名', trigger: 'change'},
                        ],
                        gender: [
                            {required: true, message: '请输入性别', trigger: 'change'},
                        ],
                        age: [
                            {required: true, message: '请输入年龄', trigger: 'blur'},
                        ],
                        nationalityl: [
                            {required: true, message: '请输入国籍', trigger: 'blur'},
                        ],
                        department: [
                            {required: true, message: '请输入科别', trigger: 'blur'},
                        ],
                        bedNumber: [
                            {required: true, message: '请输入床号', trigger: 'blur'},
                        ],
                        medicalHistory: [
                            {required: true, message: '请输入既往病史', trigger: 'blur'},
                        ],
                        tansfusionHistory: [
                            {required: true, message: '请输入既往输血史', trigger: 'blur'},
                        ],
                        prengancy: [
                            {required: true, message: '请输入孕次数', trigger: 'blur'},
                        ],
                        production: [
                            {required: true, message: '请输入产次数', trigger: 'blur'},
                        ],
                        territorial: [
                            {required: true, message: '请输入属地', trigger: 'blur'},
                        ],
                        unit: [
                            {required: true, message: '请输入单位', trigger: 'blur'},
                        ],
                    }
                }
            },
            created() {
                this.loadTable(this.pageNum);
                this.getNationality();
                this.getAllDepartment();
            },
            mounted() {},
            methods: {
                //计数控件
                handleChange(value) {
                    console.log(value);
                },
                handleDelete(index, row) {
                    console.log(index, row);
                },
                handleEdit(index, row) {
                    this.form={}
                    console.log(index, row);
                    this.updateForm=row
                    this.dialogUpdateVisible = true
                },

                loadTable(num) {
                    this.pageNum = num;
                    $.get("/patient/list").then(res => {
                        this.tableData=res.data.records;
                        console.log(res.data.records);
                    });
                },
                //省市区三级联动
                addressChoose(value) {
                    console.log("地址", value);
                    console.log('省市区：',CodeToText[value[0]],CodeToText[value[1]],CodeToText[value[2]]);
                },
                add() {
                    this.dialogVisible = true;
                    this.form = {};
                },
                save() {
                    let data = JSON.stringify(this.addForm);
                    console.log(data)
                    if (this.form.medicalRecordNumber==null) {
                        // 新增
                        $.ajax({
                            url: '/patient/addpatient',
                            type: 'post',
                            contentType: 'application/json',
                            data: data
                        }).then(res => {
                            this.dialogVisible = false;
                            this.loadTable(1);
                        })
                    }
                    console.log(123)
                },
                //民族下拉框获取数据库数据
                getNationality(){
                    $.ajax({
                        url: '/patient/nationality',
                        type: 'get',
                        contentType: 'application/json',
                    }).then(res => {
                        this.optionNationality=res
                    })
                },
                //一级科室下拉框获取数据库中一级科室
                getAllDepartment(){
                    $.ajax({
                        url: '/patient/department_list',
                        type: 'get',
                        contentType: 'application/json',
                    }).then(res =>{
                        this.parentDepartmentGroups=res
                        console.log(res);
                        }
                    )
                },
                //根据一级科室获取二级科室
                getDcode(){
                  console.log(this.departmentSample.code)
                    this.code1=this.departmentSample.code
                    axios.get('/patient/department',{
                        params:{
                            code1:this.code1,
                        },
                    }).then(res =>{
                            this.childDepartmentGroups=res.data

                            console.log(res.data);
                        }
                    )
                },

                //提交临床输血申请
                saveClinic(){
                    let data = JSON.stringify(this.clinicSample);
                    console.log(data)
                    if (this.form.medicalRecordNumber==null) {
                        // 新增
                        $.ajax({
                            url: '/bloodtransfusion/clinic/addformdata',
                            type: 'post',
                            contentType: 'application/json',
                            data: data
                        }).then(res => {
                            this.dialogClinicVisible = false;
                            this.dialogTranVisible = false;
                            this.loadTable(1);
                        })
                    }
                },
                //提交自体输血申请
                saveAuto(){
                    let data = JSON.stringify(this.autoSample);
                    console.log(data)
                        // 新增
                        $.ajax({
                            url: '/bloodtransfusion/auto/addformdata',
                            type: 'post',
                            contentType: 'application/json',
                            data: data
                        }).then(res => {
                            this.dialogAutoVisible = false;
                            this.dialogTranVisible = false;
                            this.loadTable(1);
                        })
                },
                //提交术中自体输血申请
                saveSurgey(){
                    let data = JSON.stringify(this.surgeySample);
                    console.log(data)
                    if (this.form.medicalRecordNumber==null) {
                        // 新增
                        $.ajax({
                            url: '/bloodtransfusion/surgey/addformdata',
                            type: 'post',
                            contentType: 'application/json',
                            data: data
                        }).then(res => {
                            this.dialogSurgeyVisible = false;
                            this.dialogTranVisible = false;
                            this.loadTable(1);
                        })
                    }
                },
                //删除
                del(patientIdCard) {
                    $.ajax({
                        url: '/patient/'+patientIdCard ,
                        type: 'delete',
                        contentType: 'application/json'
                    }).then(res => {
                        this.loadTable(1);
                    })
                },
                transfusion(){
                    this.dialogTranVisible=true;
                },
                clinic() {
                    this.dialogClinicVisible=true;
                },
                auto() {
                    this.dialogAutoVisible=true;
                },
                surgey() {
                    this.dialogSurgeyVisible=true;
                },
                //点击病人病案号显示病人信息
                viewInfo(row) {
                    this.dialogPatientVisible = true;
                    this.addForm = row
                    this.addForm = JSON.parse(JSON.stringify(row))
                },
                bloodInfo(){
                    console.log(this.bloodSample.patientIdCard)
                    $.post("/bloodtransfusion/clinic/list12",{patientIdCard:this.bloodSample.patientIdCard}).then(res => {
                        this.bloodSample=JSON.parse(JSON.stringify(res.data[0]))
                        console.log(this.bloodSample)
                        console.log(res)
                    });
                },
                close(){
                    this.dialogPatientVisible=false;
                },
                //取消按钮
                cancel() {
                    this.addForm.medicalRecordNumber = ''
                    this.addForm.idcard = ''
                    this.addForm.name = ''
                    this.addForm.gender = ''
                    this.addForm.age = ''
                    this.addForm.nationality = ''
                    this.department=''
                    this.bedNumber=''
                    this.medicalHistory=''
                    this.tansfusionHistory=''
                    this.prengancy=''
                    this.production=''
                    this.territorial=''
                    this.unit=''
                    this.dialogVisible = false
                }
            }

        })
    })()
</script>
</body>
</html>